﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/MainContent.Master" Inherits="System.Web.Mvc.ViewPage<MShop.Web.Components.Paging.PagedList<MShop.Core.Domain.Trade>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	交易管理
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<% using (Html.BeginForm())
   { %>
      <div id="fullBox">
        <div class="tabListBoxHead">
            <div style="float: left; padding-top: 3px;">
                <img src="/Content/add.png" width="16" height="16" border="0" align="absmiddle" style="margin-right: 3px;" />                 
            </div>
            <div style="float: right;">
                订单状态：  <%=Html.DropDownList("status", ViewData["status"] as IEnumerable<SelectListItem>)%>
                订单编号：  <%=Html.TextBox("key", Request.Params["key"], new { @class = "inputSearchBox" })%>
                <input type="submit" value="查询" class="btn" />
            </div>
        </div>
        <div class="tabListBox">
            <table id="ETList" cellpadding="0" cellspacing="0">
                <thead>
                    <tr>
                      <th>
                            订单编号
                        </th>
                        <th>
                            会员
                        </th>
                        <th>
                            地址
                        </th>
                          <th>
                            配送方式
                        </th>
                        <th>
                           支付方式
                        </th>                         
                         <th>
                           交易金额
                        </th>
                          <th>
                             订单状态
                        </th>
                        <th>
                             创建日期
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    <% foreach (var item in Model)
                       { %>
                    <tr  > <td>
                      <%=Html.ActionLink(item.TradeId, "Edit", new { id = item.TradeId }, new { @title = "编辑" })%>                     
                        </td>     
                        <td>
                            <%: item.ShopUsers.FullName%>
                          
                        </td>
                        <td>
                             <%: item.Location%>
                        </td>
                        <td>
                              <%: item.Distribution.Name%>
                        </td>
                           <td>
                              <%: item.Pay.PayName%>
                        </td>
                        
                           <td>
                               <%: item.TotalSum%>
                        </td>  
                         <td>
                               <%: item.GetTradeStatus(item.TradeStatus)%>
                        </td>   
                           <td>
                               <%: item.Created%>
                        </td>                           
                        <td>                            
                            <%=Html.ActionImageLink("/Content/remove.png", "Delete", new { id = item.TradeId }, new { @title = "删除", @onclick = "return confirm('确认删除该订单?');" })%>
                        </td>
                    </tr>
                    <% } %>
                </tbody>
            </table>
        </div>
        <%=Html.Pager(Model.PageSize, Model.PageNumber, Model.TotalItemCount, HttpVerbs.Post, "page")%>
        <input type="hidden" name="page" id="page"  />
    </div>
    <%} %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
<script type="text/javascript">
    $(document).ready(function () {
        var windowWidth = $("#fullBox").width();
        var windowHeight = $("#fullBox").height() - 60;
        $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
        $(window).resize(function () {
            var windowWidth = $("#fullBox").width();
            var windowHeight = $("#fullBox").height() - 60;
            $('.tabListBox').css({ 'width': windowWidth + 'px', 'height': windowHeight + 'px' });
        });
        $('.tabListBox').fixedHeaderTable({ footer: false, cloneHeaderToFooter: false, autoResize: true, fixCol1: true });

        $('.tabListBox').find("tbody").find("tr").each(function (i) {
            if (i % 2 == 1) {
                $(this).find("td").addClass("tr1");
            }
        });
        $('.tabListBox').find("tbody").find("tr").mouseover(function (i) {
            $(this).find("td").addClass("tr0");
        });
        $('.tabListBox').find("tbody").find("tr").mouseout(function (i) {
            $(this).find("td").removeClass("tr0");
        });

    });
    </script>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>

